package com.ruibang.glass.produce.mapper;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruibang.glass.common.domain.quality.MaterialLotItem;
import com.ruibang.glass.produce.constant.Constants;
import com.ruibang.glass.produce.domain.req.TrRecordReq;
import com.ruibang.glass.produce.domain.resp.TrProductionRecord;
import com.ruibang.glass.produce.entity.FatalDefect;
import com.ruibang.glass.produce.entity.ProductionRecord;
import com.ruibang.glass.produce.entity.TotalEquData;
import com.teaming.cloud.framework2.autoconfigure.dynamic.datasource.annotation.DS;
import com.teaming.cloud.framework2.autoconfigure.mybatisplus.mapper.CommonMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ProductionRecordMapper extends CommonMapper<Object> {

    @DS("cold1_bc2mes")
    List<ProductionRecord> getCurrentTimeTrRecord(@Param("year") int year, @Param("month") int month, @Param("day") int day, @Param("hour") int hour);

    @DS(Constants.COLD_DATA_SOURCE_NAME)
    List<TotalEquData> getDefectInfo(@Param("glassIds") List<String> glassIds);

    List<FatalDefect> getFatalDefect();

    @DS("cold1_bc2mes")
    IPage<TrProductionRecord> pageQuery(Page<TrProductionRecord> page, @Param("trRecordReq") TrRecordReq trRecordReq);

    List<MaterialLotItem> getLotItemInfo(@Param("coldIds") List<String> coldIds);
}
